<?php
namespace app\index\controller;

use think\Db;

class Publics extends Base
{
    /**
     * 退出
     */
    public function logOut(){
        $user = new \app\index\model\User();
        $user->logOut();
        r(url('Publics/logIn'));
    }
    
    /**
     * 登陆
     */
    public function logIn(){        
        if( is_post() ){
        }
        return 'login...';           
        $this->view->engine->layout(false);
        return $this->fetch();
    }
    
    /**
     * 短网址跳转
     * @param unknown $id
     */
    public function shortUrl( $id ){
        $url = Db::name('short')->where('id',$id)->value('url');
        if($url)
            r($url);
        exit('error...');
    }
}
